<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <title>Zend Framework &amp; MVC Introduction - Zend Framework Manual</title>

    <link href="../css/shCore.css" rel="stylesheet" type="text/css" />
    <link href="../css/shThemeDefault.css" rel="stylesheet" type="text/css" />
    <link href="../css/styles.css" media="all" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>Zend Framework</h1>
<h2>Programmer's Reference Guide</h2>
<ul>
    <li><a href="../en/learning.quickstart.intro.html">Inglês (English)</a></li>
    <li><a href="../pt-br/learning.quickstart.intro.html">Português Brasileiro (Brazilian Portuguese)</a></li>
</ul>
<table width="100%">
    <tr valign="top">
        <td width="85%">
            <table width="100%">
                <tr>
                    <td width="25%" style="text-align: left;">
                    <a href="learning.quickstart.html">Zend Framework Quick Start</a>
                    </td>

                    <td width="50%" style="text-align: center;">
                        <div class="up"><span class="up"><a href="learning.quickstart.html">Zend Framework Quick Start</a></span><br />
                        <span class="home"><a href="manual.html">Programmer's Reference Guide</a></span></div>
                    </td>

                    <td width="25%" style="text-align: right;">
                        <div class="next" style="text-align: right; float: right;"><a href="learning.quickstart.create-project.html">Create Your Project</a></div>
                    </td>
                </tr>
            </table>
<hr />
<div id="learning.quickstart.intro" class="section"><div class="info"><h1 class="title">Zend Framework &amp; MVC Introduction</h1></div>
    

    <div class="section" id="learning.quickstart.intro.zf"><div class="info"><h1 class="title">Zend Framework</h1></div>
        

        <p class="para">
            Zend Framework is an open source, object oriented web application framework for
            <acronym class="acronym">PHP</acronym> 5. Zend Framework is often called a &#039;component library&#039;, because
            it has many loosely coupled components that you can use more or less independently. But
            Zend Framework also provides an advanced Model-View-Controller (<acronym class="acronym">MVC</acronym>)
            implementation that can be used to establish a basic structure for your Zend Framework
            applications. A full list of Zend Framework components along with short descriptions may
            be found in the <a href="http://framework.zend.com/about/components" class="link external">&raquo; components overview</a>. This
            QuickStart will introduce you to some of Zend Framework&#039;s most commonly used components,
            including <span class="classname">Zend_Controller</span>, <span class="classname">Zend_Layout</span>,
            <span class="classname">Zend_Config</span>, <span class="classname">Zend_Db</span>,
            <span class="classname">Zend_Db_Table</span>, <span class="classname">Zend_Registry</span>, along
            with a few view helpers.
        </p>

        <p class="para">
            Using these components, we will build a simple database-driven guest book application
            within minutes. The complete source code for this application is available in the
            following archives:
        </p>

        <ul class="itemizedlist">
            <li class="listitem">
                <p class="para">
                    <a href="http://framework.zend.com/demos/ZendFrameworkQuickstart.zip" class="link external">&raquo; zip</a>
                </p>
            </li>

            <li class="listitem">
                <p class="para">
                    <a href="http://framework.zend.com/demos/ZendFrameworkQuickstart.tar.gz" class="link external">&raquo; tar.gz</a>
                </p>
            </li>
        </ul>
    </div>

    <div class="section" id="learning.quickstart.intro.mvc"><div class="info"><h1 class="title">Model-View-Controller</h1></div>
        

        <p class="para">
            So what exactly is this <acronym class="acronym">MVC</acronym> pattern everyone keeps talking about, and
            why should you care? <acronym class="acronym">MVC</acronym> is much more than just a three-letter
            acronym (<acronym class="acronym">TLA</acronym>) that you can whip out anytime you want to sound smart;
            it has become something of a standard in the design of modern web applications. And for
            good reason. Most web application code falls under one of the following three
            categories: presentation, business logic, and data access. The <acronym class="acronym">MVC</acronym>
            pattern models this separation of concerns well. The end result is that your
            presentation code can be consolidated in one part of your application with your business
            logic in another and your data access code in yet another. Many developers have found
            this well-defined separation indispensable for keeping their code organized, especially
            when more than one developer is working on the same application.
        </p>

        <blockquote class="note"><p><b class="note">Note</b>: <span class="info"><b>More Information</b><br /></span>
            

            <p class="para">
                Let&#039;s break down the pattern and take a look at the individual pieces:
            </p>

            <p class="para">
                <div class="inlinemediaobject"><div class="imageobject"><a href="images/d481d625821a97b9a5eb2cec99dca50e-learning.quickstart.intro.mvc.png"><img src="images/d481d625821a97b9a5eb2cec99dca50e-learning.quickstart.intro.mvc.png" alt="learning.quickstart.intro.mvc.png" width="450" height="315" /></a></div></div>
            </p>

            <ul class="itemizedlist">
                <li class="listitem">
                    <p class="para">
                        <em class="emphasis">Model</em> - This is the part of your
                        application that defines its basic functionality behind a set of
                        abstractions. Data access routines and some business logic can be defined in
                        the model.
                    </p>
                </li>

                <li class="listitem">
                    <p class="para">
                        <em class="emphasis">View</em> - Views define exactly what is
                        presented to the user. Usually controllers pass data to each view to render
                        in some format. Views will often collect data from the user, as well. This
                        is where you&#039;re likely to find <acronym class="acronym">HTML</acronym> markup in your
                        <acronym class="acronym">MVC</acronym> applications.
                    </p>
                </li>

                <li class="listitem">
                    <p class="para">
                        <em class="emphasis">Controller</em> - Controllers bind the whole
                        pattern together. They manipulate models, decide which view to display based
                        on the user&#039;s request and other factors, pass along the data that each view
                        will need, or hand off control to another controller entirely. Most
                        <acronym class="acronym">MVC</acronym> experts recommend <a href="http://weblog.jamisbuck.org/2006/10/18/skinny-controller-fat-model" class="link external">&raquo; keeping
                        controllers as skinny as possible</a>.
                    </p>
                </li>
            </ul>

            <p class="para">
                Of course there is <a href="http://ootips.org/mvc-pattern.html" class="link external">&raquo; more to be
                    said</a> about this critical pattern, but this should give you enough
                background to understand the guestbook application we&#039;ll be building.
            </p>
        </p></blockquote>
    </div>
</div>
        <hr />

            <table width="100%">
                <tr>
                    <td width="25%" style="text-align: left;">
                    <a href="learning.quickstart.html">Zend Framework Quick Start</a>
                    </td>

                    <td width="50%" style="text-align: center;">
                        <div class="up"><span class="up"><a href="learning.quickstart.html">Zend Framework Quick Start</a></span><br />
                        <span class="home"><a href="manual.html">Programmer's Reference Guide</a></span></div>
                    </td>

                    <td width="25%" style="text-align: right;">
                        <div class="next" style="text-align: right; float: right;"><a href="learning.quickstart.create-project.html">Create Your Project</a></div>
                    </td>
                </tr>
            </table>
</td>
        <td style="font-size: smaller;" width="15%"> <style type="text/css">
#leftbar {
	float: left;
	width: 186px;
	padding: 5px;
	font-size: smaller;
}
ul.toc {
	margin: 0px 5px 5px 5px;
	padding: 0px;
}
ul.toc li {
	font-size: 85%;
	margin: 1px 0 1px 1px;
	padding: 1px 0 1px 11px;
	list-style-type: none;
	background-repeat: no-repeat;
	background-position: center left;
}
ul.toc li.header {
	font-size: 115%;
	padding: 5px 0px 5px 11px;
	border-bottom: 1px solid #cccccc;
	margin-bottom: 5px;
}
ul.toc li.active {
	font-weight: bold;
}
ul.toc li a {
	text-decoration: none;
}
ul.toc li a:hover {
	text-decoration: underline;
}
</style>
 <ul class="toc">
  <li class="header home"><a href="manual.html">Programmer's Reference Guide</a></li>
  <li class="header up"><a href="manual.html">Programmer's Reference Guide</a></li>
  <li class="header up"><a href="learning.html">Learning Zend Framework</a></li>
  <li class="header up"><a href="learning.quickstart.html">Zend Framework Quick Start</a></li>
  <li class="active"><a href="learning.quickstart.intro.html">Zend Framework &amp; MVC Introduction</a></li>
  <li><a href="learning.quickstart.create-project.html">Create Your Project</a></li>
  <li><a href="learning.quickstart.create-layout.html">Create A Layout</a></li>
  <li><a href="learning.quickstart.create-model.html">Create a Model and Database Table</a></li>
  <li><a href="learning.quickstart.create-form.html">Create A Form</a></li>
  <li><a href="learning.quickstart.conclusion.html">Congratulations!</a></li>
 </ul>
 </td>
    </tr>
</table>

<script type="text/javascript" src="../js/shCore.js"></script>
<script type="text/javascript" src="../js/shAutoloader.js"></script>
<script type="text/javascript" src="../js/main.js"></script>

</body>
</html>